<template>
  <div>
    <pic v-bind:msg="people"></pic>
  </div>

</template>

<script>
  import  pic from "./picture"
  export default {
    data () {
      return {
        people:[],
        msg:"父组件传来的消息"
      }
    },
    created: function () {
      // `this` 指向 vm 实例
      this.get();
    },
    methods: {
      get: function () {
        //发送get请求
        this.$http.get('./static/a.json').then(function (res) {
          //this.people=this.people.concat(res.body);
          this.people=res.body
        }, function () {
          console.log('请求失败处理')
        })
      },
      update:function () {
        this.people[0]['name']="xcyxcyxcy"
      }
    },
    components:{
       pic
    }
  }
</script>

<style>

</style>
